﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Corina.Datamodel.Base
{
    public class DatabaseColumn
    {
        public DatabaseColumn() { }

        public DatabaseColumn(string name)
        {
            ColumnName = name;
        }

        public DatabaseColumn(string name, bool primary, bool writeOnce = false)
        {
            ColumnName = name;
            IsPrimaryKey = primary;
            WriteOnce = writeOnce;
        }

        public DatabaseColumn(string name, int length, bool writeOnce = false)
        {
            ColumnName = name;
            Length = length;
            WriteOnce = writeOnce;
        }

        #region ColumnName
        private string _columnName = string.Empty;
        public string ColumnName
        {
            get { return _columnName; }
            set
            {
                _columnName = value;
            }
        }
        #endregion

        #region IsPrimaryKey
        private bool _isPrimaryKey = false;
        public bool IsPrimaryKey
        {
            get { return _isPrimaryKey; }
            set
            {
                _isPrimaryKey = value;
            }
        }
        #endregion

        #region Length
        private int _length = 0;
        public int Length
        {
            get { return _length; }
            set
            {
                _length = value;
            }
        }
        #endregion

        #region WriteOnce
        private bool _writeOnce = false;
        public bool WriteOnce
        {
            get { return _writeOnce; }
            set
            {
                _writeOnce = value;
            }
        }
        #endregion
    }
}
